﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
using TicketMaster.Object;

namespace TicketMaster.Web.Models
{
    public class CreateCommentViewModel
    {
        public string AuthorId { get; set; }

        public double Rate { get; set; }

        public string Content { get; set; }

        public bool IsPositive { get; set; }

        public int RouteId { get; set; }

        public static Expression<Func<Comment, CreateCommentViewModel>> FromComment
        {
            get
            {
                return x => new CreateCommentViewModel
                {
                   AuthorId = x.AuthorId,
                   Rate = x.Rate,
                   Content = x.Content,
                   IsPositive = x.IsPositive,
                   RouteId = x.RouteId
                };
            }
        }
    }
}